package com.stars.home.vmodel

import android.app.Application
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.viewModelScope
import com.stars.home.model.DriverProfitTop
import com.stars.home.utils.net.NetEngine
import com.trailer.base.base.BRepository
import com.trailer.base.base.BViewModel
import kotlinx.coroutines.launch

/**
 *on 2021/5/7
 */
class MyIncomeVModel(application: Application) : BViewModel<BRepository>(application) {


    val bean = MutableLiveData<DriverProfitTop>()

    fun getHeadInfo(){
        viewModelScope.launch {
            var it=repository().lreq { NetEngine.service.driverProfitTop() }
            if(it.ok()){
                bean.value=it.data
            }
        }
    }
}
